package com.vcc.data.mapper;

import com.mybatisflex.core.BaseMapper;
import com.vcc.data.entity.BossRolePermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BossRolePermissionMapper extends BaseMapper<BossRolePermission> {

    @Select("select brp.* from vcc_boss_user_boss_role bur left join vcc_boss_role br on bur.boss_role_id = br.id join vcc_boss_role_permission brp on br.id = brp.boss_role_id where bur.user_id = #{userId}")
    List<BossRolePermission> findAllByUserId(@Param("userId") Long userId);
}
